<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>USDT通道管理</title>
    <link rel="stylesheet" href="<?=userassets?>component/pear/css/pear.css" />
    <style>
        .main-container {
            padding: 15px;
            background-color: #fff;
        }
        .notice-bar {
            background: #fff2f0;
            padding: 8px 12px;
            margin-bottom: 15px;
            color: #ff4d4f;
            font-size: 13px;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .status-container {
            display: flex;
            margin-bottom: 15px;
            background: #fff;
            font-size: 13px;
        }
        .status-box {
            flex: 1;
            padding: 10px 15px;
        }
        .status-box + .status-box {
            border-left: 1px solid #f0f0f0;
        }
        .status-title {
            color: #333;
            margin-bottom: 8px;
        }
        .status-items {
            display: flex;
            gap: 15px;
            color: #666;
        }
        .status-item {
            display: flex;
            align-items: center;
            gap: 4px;
        }
        .button-row {
            display: flex;
            justify-content: space-between;
            margin: 15px 0;
        }
        .button-group {
            display: flex;
            gap: 8px;
        }
        .custom-btn {
            height: 28px;
            line-height: 26px;
            padding: 0 12px;
            font-size: 13px;
            border-radius: 2px;
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }
        .btn-blue {
            background: #1e9fff;
            color: #fff;
            border: none;
        }
        .btn-green {
            background: #5fb878;
            color: #fff;
            border: none;
        }
        .layui-table-view {
            margin: 0;
        }
        .layui-form-item {
            margin-bottom: 25px;
        }
        
        .layui-form-label {
            width: 100px;
            padding: 9px 15px;
            font-size: 14px;
            color: #333;
        }
        
        .layui-input-block {
            margin-left: 130px;
        }
        
        .layui-input {
            height: 38px;
            line-height: 38px;
            border: 1px solid #e6e6e6;
            border-radius: 2px;
            padding: 0 12px;
            transition: all .3s;
        }
        
        .layui-input:hover {
            border-color: #1e9fff;
        }
        
        .layui-input:focus {
            border-color: #1e9fff;
            box-shadow: 0 0 0 2px rgba(30,159,255,0.1);
        }
        
        .layui-form-danger {
            background-color: #f8f8f8;
            color: #999;
        }
        
        .bottom {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: #fff;
            padding: 15px 20px;
            text-align: center;
            box-shadow: 0 -1px 3px rgba(0,0,0,0.1);
        }
        
        .button-container {
            display: flex;
            justify-content: center;
            gap: 15px;
        }
        
        .button-container .layui-btn {
            padding: 0 25px;
            height: 32px;
            line-height: 32px;
            font-size: 13px;
        }
        
        .required-label::before {
            content: "*";
            color: #ff4d4f;
            margin-right: 4px;
        }
        
        .input-description {
            font-size: 12px;
            color: #999;
            margin-top: 5px;
        }
        .tip-text-with-icon {
            display: flex;
            align-items: center;
            margin-top: 8px;
            padding: 8px 12px;
            background: rgba(30,159,255,0.1);
            border-radius: 4px;
            color: #1e9fff;
            font-size: 13px;
        }
        .tip-text-with-icon:before {
            content: "💡";
            margin-right: 8px;
        }
        
    </style>
</head>
<body class="pear-container">
    <?php if ($my == "list") : ?>
        <div class="main-container">
            <table id="dataTable" lay-filter="dataTable"></table>
            <script type="text/html" id="toolbar">
                <div class="pear-btn pear-btn-primary pear-btn-md">
                    <button class="custom-btn btn-blue" lay-event="add">新增通道 (当前: <div id="allqrlist">0</div>/最大: <div id="maxqrlist">0</div>)</button>
                </div>
            </script>
            <script type="text/html" id="tableBar">
                <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">编辑</a>
                <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
            </script>
        </div>
    <?php endif;?>
    <?php if($my == 'add' || $my == 'edit'):?>
       
        <form class="layui-form" action="">
            <div class="mainBox">
                <div class="main-container">
                    <div class="layui-form-item">
                        <label class="layui-form-label">USDT-TRC20 收款地址</label>
                        <div class="layui-input-block">
                            <input type="text" class="layui-input" name="qr_url" value="<?=$row['qr_url']?>"/>
                        </div>
                        <div class="tip-text-with-icon">请确保地址正确，收款错误无法追回</div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label" >备注</label>
                        <div class="layui-input-block">
                            <input type="text" class="layui-input" name="beizhu" id="beizhu" value="<?=$row['beizhu']?>" />
                        </div>
                    </div>
                    <?php if($my == 'edit'):?>
                        <input type="hidden" class="layui-input" name="id" id="id" value="<?=$row['id']?>" />
                        <div class="layui-form-item">
                            <label class="layui-form-label">二维码状态</label>
                            <div class="layui-input-block">
                                <select name="status"  default="">
                                    <option value="1" <?= $row['status'] == '1' ? "selected" : "" ?>>开启</option>
                                    <option value="0" <?= $row['status'] == '0' ? "selected" : "" ?>>关闭</option>
                                </select>
                            </div>
                        </div>
                    <?php endif;?>
                    <div class="layui-form-item"></div>
                </div>
            </div>
            <div class="bottom">
                <div class="button-container">
                    <button type="submit" class="layui-btn layui-btn-normal" lay-submit lay-filter="<?=($my == 'add')?'addSave':'editSave'?>">
                        <i class="layui-icon layui-icon-ok"></i><?=($my == 'add')?'添加':'修改'?>通道
                    </button>
                    
                </div>
            </div>
        </form>
     
    <?php endif;?>
    
<script src="<?=userassets?>component/layui/layui.js"></script>
<script src="<?=userassets?>component/pear/pear.js"></script>
<script src="<?=userassets?>core_js/usdt.js?v=<?=time()?>"></script>
</body>
</html>